package com.lyu.travel.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lyu.travel.core.entity.Place;
import com.lyu.travel.core.entity.Province;
import com.lyu.travel.core.entity.User;
import org.apache.ibatis.annotations.Select;

/**
 * @ProjectName: [travel]
 * @Package: [com.lyu.travel.core.mapper]
 * @ClassName: [ProvinceMapper]
 * @Description: 省份接口
 * @Author: [78483]
 * @CreateDate: [2020-06-01 11:22]
 * @UpdateUser: [78483]
 * @UpdateDate: [2020-06-01 11:22]
 * @UpdateRemark: [说明本次修改内容]
 * @Version: [v1.0]
 */
public interface ProvinceMapper extends BaseMapper<Province> {
    @Select(" select * from t_province where name = #{name}")
    public Province findByProvincename(String name);

    @Select("UPDATE t_province AS a SET placecounts= (select count(*) FROM t_place WHERE provinceid=a.id)")
    public Province updatePlacecounts();


}
